package net.seehealth.healthpad.ui;

import net.seehealth.healthpad.R;
import net.seehealth.healthpad.application.adapter.GridViewAdapter;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
/**
 * 
 * @className HealthRecordsActivity
 * @author wuhongjie
 * @description TODO
 * @date 2012-4-13 下午7:29:32
 */
public class HealthRecordsActivity extends GridViewActivity{
	
	@Override
	protected void initData() {
		mTitle.setText("健康记录");
		
		int[] ids = new int []{1,1,1,1,1,1};
		String[] contents = {"同时下载多个文件，容易出现无法下载等情况",
				"同时下载多个文件，容易出现无法下载等情况",
				"同时下载多个文件，容易出现无法下载等情况",
				"同时下载多个文件，容易出现无法下载等情况",
				"同时下载多个文件，容易出现无法下载等情况",
				"同时下载多个文件，容易出现无法下载等情况"};
		int[] imgs = new int[] { R.drawable.gridview_medical_report,
				R.drawable.gridview_treatment_report, R.drawable.gridview_drug_report,
				R.drawable.gridview_general_question, R.drawable.gridview_scl90_question,
				R.drawable.gridview_traditional_chinese_question};
		
		mGridViewAdapter = new GridViewAdapter(this, contents, imgs, ids, false);
		mGridView.setAdapter(mGridViewAdapter);
		mGridView.setOnItemClickListener(onItemClick);
	}
	
	OnItemClickListener onItemClick = new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
				long arg3) {
			if(arg2 == 2){
				fillChronicAssessment();
			}else{
				fillMedicalReport();
			}
			
		}
	};
	
	/**
	 * 填充慢病风险评估数据
	 */
	private void fillChronicAssessment(){
		//showPopWindowAmini(R.layout.pop_chronic_assessment,mGridView,0,0);
		Intent intent = new Intent(HealthRecordsActivity.this, RiskAssessmentActivity.class);
		startActivity(intent);
		overridePendingTransition(R.anim.popshow_anim, R.anim.pophidden_anim);
		
	}
	
	
	/**
	 * 
	 * @description:填充体检报告数据
	 * @param 
	 * @return 
	 * @throws Exception   
	 * @author TODO
	 * @date 2012-4-13 下午7:28:53
	 */
	private void fillMedicalReport(){
//		showPopWindowAmini(R.layout.pop_gridview_medical_report,mGridView,0,0);
		Intent intent = new Intent(HealthRecordsActivity.this, MedicalReportActivity.class);
		startActivity(intent);
		overridePendingTransition(R.anim.popshow_anim, R.anim.pophidden_anim);
	}
	
}
